﻿using Abp.Domain.Entities.Auditing;
using KDS.Mes.Mes.Factorys;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace KDS.Mes.Mes.Workshops
{
    /// <summary>
    /// 车间信息
    /// </summary>
    [Table("T_BasicWorkshop")]
    public class Workshop : FullAuditedEntity
    {
        /// <summary>
        /// 所属工厂
        /// </summary>
        [ForeignKey("FactoryId")]
        public virtual Factory Factory { get; set; }

        public virtual int FactoryId { get; set; }

        /// <summary>
        /// 车间名称
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string WorkshopName { get; set; }

        /// <summary>
        /// 车间代码
        /// </summary>
        [Required]
        [MaxLength(20)]
        public string WorkshopCode { get; set; }

        public Workshop(int factoryId,string workshopName, string workshopCode)
        {
            FactoryId = factoryId;
            WorkshopName = workshopName;
            WorkshopCode = workshopCode;

        }

        public Workshop()
        {

        }
    }
}